@{
    ViewBag.Title = "对话框管理";
}
@section head{
   <script type="text/javascript">
       $(document).ready(function () {
           $('.btnSearch').click(function () {
               mainSearch('.search_box :input');
           });
       });
       function on_close(key) {
           $('#details').datagrid('reload');
       }
       function onDeleteData() {
           $('#details').datagrid('reload');
       }
       function fieldformatter(value, row, index) {
           return '<a href="javascript:show_fullscreen_dialog(\'@Url.Action("Index","DialogField")?DialogCode=' + row.DialogCode + '\',on_close,\'field\')" style=" display:block" >' + value + '</a>';
       }
       function cmdformat(value, row, index) {
           return '<a href="javascript:show_fullscreen_dialog(\'' + serverUrl.edit + '?DialogCode=' + row.DialogCode + '\',on_close,\'edit\')">修改</a>&nbsp; <a href="javascript:Del(\'' + row.DialogCode + '\',onDeleteData)">删除</a>';
       }
   </script>
}
@section body{
<body style="padding:@ViewBag.Padding">
<div class="easyui-layout" data-options="fit:true">
    <div region="north" border="false">
        <div class="navigation">@ViewBag.CurrentPath</div>
        <div class="tools_box">
	        <div class="tools_bar">
                <div class="left">
                   <a href="javascript:search_click()" id="search" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true ">查询</a>  
                   <a href="javascript:show_fullscreen_dialog(serverUrl.add ,on_close,'add')" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true ">添加</a>  
                   <a href="javascript:DeleteSelecteds($('#details').datagrid('getSelections'),'DialogCode',onDeleteData)" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true">批量删除</a>
                </div>
            </div>
            <div class="search_box">
			    编号：<input type="text" name="DialogCode" class="txtSearchInput" />
                标题：<input type="text" name="Title" class="txtSearchInput" />
                <input type="submit" value="查询" class="btnSearch"/>
		    </div>
        </div>
    </div> 
    <div region="center" border="false">
        <table class="easyui-datagrid" id="details" data-options="fit:true,rownumbers:true,singleSelect:false,
          pagination:true,border:true,url:serverUrl.list">
           <thead data-options="frozen:true"> 
              <tr>
                   <th data-options="field:'id',checkbox:true"></th>
                   <th data-options="field:'DialogCode',sortable:true,width:120">编号</th>
              </tr>
           </thead>
           <thead>  
               <tr>  
                   <th data-options="field:'Title',sortable:true,width:150">标题</th>
                   <th data-options="field:'Database',sortable:true,width:120">数据库</th>
                   <th data-options="field:'Width',sortable:true,width:100">宽度</th>
                   <th data-options="field:'Height',sortable:true,width:100">高度</th>
                   <th data-options="field:'ResultFieldKey',sortable:true,width:100">返回值</th>
                   <th data-options="field:'FieldCount',width:100,align:'center',formatter:fieldformatter">栏位管理</th>
                   <th data-options="field:'cmd',width:100,align:'center',formatter:cmdformat">操作</th>
               </tr>  
           </thead>  
        </table>
    </div>
</div>
</body>
}